"""
物联网实名相关接口
包含实名登记、实名状态查询等接口方法。
"""
from .api_utils import md5, get_tkey, post_api

def card_realname_register(userName, passWord, iccid, realNameInfo):
    """物联网卡实名登记接口"""
    url = "https://api.tibiot.com/api/v1/card/simRealNameReg"
    tKey = get_tkey()
    pw = md5(md5(passWord) + tKey)
    data = {"userName": userName, "passWord": pw, "tKey": tKey, "iccid": iccid, "realNameInfo": realNameInfo}
    return post_api(url, data)

def card_realname_status_query(userName, passWord, iccid):
    """物联网卡实名登记状态查询接口"""
    url = "https://api.tibiot.com/api/v1/card/simRegionLimitArea"
    tKey = get_tkey()
    pw = md5(md5(passWord) + tKey)
    data = {"userName": userName, "passWord": pw, "tKey": tKey, "iccid": iccid}
    return post_api(url, data)
